#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define For(i,a,b) for(ll i=(a);i<=(b);++i)
const int N=100010;
ll t[N],f[N],ans[N];
ll n,s;
int main(){
//	freopen("elizabeth.in","r",stdin);
//	freopen("elizabeth.out","w",stdout);
	cin>>n>>s;
	For(i,1,n){
		ll x,y;cin>>x>>y;
		t[i]=t[i-1]+x;
		f[i]=f[i-1]+y;
	}
	memset(ans,0x3f,sizeof(ans));ans[0]=0;
	For(i,1,n)For(j,0,i-1)ans[i]=min(ans[i],ans[j]+(f[i]-f[j])*t[i]+s*(f[n]-f[j]));
	cout<<ans[n]<<endl;
	return 0;
}
